package com.shangbang.verb.service.impl.recruit;

import com.shangbang.verb.dao.recruit.WorkMapper;
import com.shangbang.verb.entity.recruit.WorkEntity;
import com.shangbang.verb.service.recruit.WorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkServiceImpl implements WorkService {
    @Autowired
    private WorkMapper workMapper;


    @Override
    public Object createWorkInfo(Integer uid, String position, String introduction, String claim, String welfare,
                                 String salary, String workType, String phone, String enterpriseName, String place,
                                 String lat, String img, String lng) {
        WorkEntity workEntity = new WorkEntity();
        workEntity.setWorkId(uid);
        workEntity.setPosition(position);
        workEntity.setIntroduction(introduction);
        workEntity.setClaim(claim);
        workEntity.setWelfare(welfare);
        workEntity.setSalary(salary);
        workEntity.setWorkType(workType);
        workEntity.setPhone(phone);
        workEntity.setEnterpriseName(enterpriseName);
        workEntity.setPlace(place);
        workEntity.setLat(lat);
        workEntity.setImg(img);
        workEntity.setLng(lng);
        workMapper.insert(workEntity);
        return "";
    }

    @Override
    public Object getWorkList(Integer page, Integer num) {
       List<WorkEntity> list =  workMapper.getList(page,num);
           return list;

    }
}
